package examples.java.spi;

import java.util.Comparator;

/**
 * @author Bill
 * @version 2013-05-30
 */
public class UserComparator implements Comparator<User> {

    @Override
    public int compare(User o1, User o2) {
        if (o1 == null) {
            return -1;
        }
        if (o2 == null) {
            return 1;
        }
        return o1.getName().compareTo(o2.getName());
    }
}
